<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta
      name="viewport"
      content="width=device-width,initial-scale=1,user-scalable=0,viewport-fit=cover"
    />
    <meta
      http-equiv="Cache-Control"
      content="no-cache, no-store, must-revalidate"
    />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>武汉一中90周年</title>
    <style>
      body {
        margin: 0;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
      }
      .index-wrapper {
        width: 100vw;
        height: 100vh;
        position: relative;
        overflow: hidden;
      }
      .bg {
        width: 100%;
        position: fixed;
        top: -20px;
      }
      @media only screen and (-webkit-device-pixel-ratio: 2) {
        .bg {
          top: -60px;
        }
      }

      .btn {
        width: 75%;
        /* height: 50px; */
        position: fixed;
        bottom: 10px;
        left: 0%;
        text-align: center;
        /* background-color: rgba(0, 0, 0, .2); */
        color: white;
        /* line-height: 50px; */
        /* border-radius: 5px; */
      }
    </style>
  </head>
  <body>
    <div class="index-wrapper">
      <img class="bg" src="images/bg.jpg" alt="" />
      <!-- <div id="btn" class="btn">开始制作</div> -->
      <img src="images/btn@3x.png" id="btn" class="btn" alt="" />
    </div>
  </body>
  <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
  <script>
    $(function () {
      // var code = getQueryVariable("code")
      // console.log(code)
      // if (window.sessionStorage.getItem("headimg")) {
      // } else {
      //   $.ajax({
      //     type: "GET",
      //     url: "https://avatar.jiuluzhai.top/api/v1/wechat/user",
      //     data: {
      //       code: code
      //     },
      //     dataType: "json",
      //     success: function(res){
      //       window.sessionStorage.setItem("headimg", res.data.headimgurl)
      //     }
      //   });
      // }

      $("#btn").click(function () {
        // window.location.href = "avatar.html?headimgurl=" + window.sessionStorage.getItem("headimg")
        window.location.href =
          "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx83f8e3b837cc1463&redirect_uri=https%3A%2F%2Favatar.jiuluzhai.top%2Favatar.html&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
      });
      function getQueryVariable(variable) {
        var query = window.location.search.substring(1);
        var vars = query.split("&");
        for (var i = 0; i < vars.length; i++) {
          var pair = vars[i].split("=");
          if (pair[0] == variable) {
            return pair[1];
          }
        }
        return false;
      }
    });
  </script>
</html>
